import QtQuick 1.0
import com.nokia.meego 1.0
import com.nokia.extras 1.0

MouseArea {
    id: root
    height: childrenRect.height + constants.defaultMargin * 2

    property alias title: title.text
    property alias catch_: catch_.text
    property variant started_at
    property variant ended_at
    property alias place: place.text

    LabelStyle { id: subTextStyle ;fontPixelSize: constants.fontSmallSize; textColor: '#505050' }

    Column {
        anchors.top: parent.top
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.margins: constants.defaultMargin
        spacing: constants.defaultMargin

        Label {
            id: title
            width: parent.width
            elide: Text.ElideRight
            platformStyle: LabelStyle { fontPixelSize: constants.fontDefaultSize; textColor: '#282828' }
        }

        Label {
            id: catch_
            x: constants.iconSmallSize + constants.defaultMargin
            width: parent.width - x
            elide: Text.ElideRight
            platformStyle: subTextStyle
        }

        Row {
            spacing: constants.defaultMargin
            Image {
                source: 'image://theme/icon-m-toolbar-clock'
                width: constants.iconSmallSize
                height: constants.iconSmallSize
                smooth: true
            }

            Label {
                text: started_at.toLocalString()
                platformStyle: subTextStyle
            }
            Label {
                text: qsTr('~')
                platformStyle: subTextStyle
            }
            Label {
                text: ended_at.toLocalString()
                platformStyle: subTextStyle
            }
        }

        Row {
            spacing: constants.defaultMargin
            Image {
                source: 'image://theme/icon-m-common-location'
                width: constants.iconSmallSize
                height: constants.iconSmallSize
                smooth: true
            }
            Label {
                id: place
                platformStyle: subTextStyle
            }
        }

        Rectangle {
            anchors.horizontalCenter: parent.horizontalCenter
            width: parent.width
            height: 2
            color: 'red'
            opacity: 0.5
        }
    }
}
